package com.study.tests;

public class ContactData implements Comparable<ContactData> {
        private String firstname;
        private String lastname;
        public String address1;
        public String homephone;
        public String mobilephone;
        public String workphone;
        private String email1;
        private String email2;
        public String bday;
        public String bmonth;
        public String byear;
        public String groupname;
        public String address2;
        public String phone2;

        @Override
        public String toString() {
                return "ContactData [lastname=" + lastname + "]";
        }

        @Override
        public int hashCode() {
                // final int prime = 31;
                int result = 1;
                // result = prime * result + ((firstname == null) ? 0 :
                // firstname.hashCode());
                return result;
        }

        @Override
        public boolean equals(Object obj) {
                if (this == obj)
                        return true;
                if (obj == null)
                        return false;
                if (getClass() != obj.getClass())
                        return false;
                ContactData other = (ContactData) obj;
                if (lastname == null) {
                        if (other.lastname != null)
                                return false;
                } else if (!lastname.equals(other.lastname))
                        return false;
                return true;
        }

        @Override
        public int compareTo(ContactData other) {

                return this.lastname.toLowerCase().compareTo(
                                other.lastname.toLowerCase());
        }

		public ContactData withFirstName(String firstname) {
			this.firstname = firstname;
			return this;
		}

		public ContactData withLastName(String lastname) {
			this.lastname = lastname;
			return this;
		}

		public ContactData withEmail1(String email1) {
			this.email1 = email1;
			return this;
		}

		public ContactData withEmail2(String email2) {
			this.email2 = email2;
			return this;
		}

		public String getFirstName() {
			return firstname;
		}

		public String getLastName() {
			return lastname;
		}

		public String getAddress1() {
			return address1;
		}

		public String getHomePhone() {
			return homephone;
		}

		public String getMobilePhone() {
			return mobilephone;
		}

		public String getWorkPhone() {
			return workphone;
		}

		public String getEmail1() {
			return email1;
		}

		public String getEmail2() {
			return email2;
		}

		public String getByDay() {
			return bday;
		}

		public String getByMonth() {
			return bmonth;
		}

		public String getByYear() {
			return byear;
		}

		public String getGroupname() {
			return groupname;
		}

		public String getAddress2() {
			return address2;
		}

		public String getPhone2() {
			return phone2;
		}

		
}